package domain.terrain;

import java.awt.Color;

import com.uqbar.vainilla.DeltaState;
import com.uqbar.vainilla.appearances.Rectangle;
import components.Shape;
import components.SquareShape;

import domain.components.WormsComponent;
import domain.weapon.Projectile;
import domain.worm.Worm;

public class SquareGround extends WormsComponent {

	public SquareGround(int aDiameter, int aHeight, double x, double y) {
		super(aDiameter, aHeight, x, y);
		this.setAppearance(new Rectangle(Color.BLACK, aDiameter, aHeight));
	}

	@Override
	public boolean isSolid() {
		return true;
	}

	@Override
	protected void onCollisionWithSolid(WormsComponent gc) {

	}

	@Override
	protected void defineCollide(WormsComponent gc) {
	}

	@Override
	protected void effectiveUpdate(DeltaState deltaState) {

	}


	public void collideWithProyectile(Projectile bullet) {
		bullet.destroyComponent();
	}
	
	public void collideWithWorm(Worm worm){
		worm.die();
	}

	@Override
	public Shape defineShape() {
		return new SquareShape(this);
	}
}
